package ys.ewp.facade;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import ys.ewp.dto.AccountDto;
import ys.ewp.dto.EmployeeDto;
import ys.ewp.po.Account;
import ys.ewp.po.Employee;
import ys.ewp.service.AccountService;

@Component
public class EmployeeFacade {
	
	@Resource(name="accountService")
	private AccountService accountService;
	
	/**
	 * @功能 根据账户获取员工
	 * @param accDto
	 * @return
	 */
	public EmployeeDto getEmployeeByAcc(AccountDto accDto){
		Account acc = accountService.get(accDto.getId());
		Employee emp = acc.getEmployee();
		EmployeeDto empDto = EmployeeDto.getDtoByPo(emp);
		System.out.println("哈哈"+empDto.getId());
		return empDto;
	}
	
}
